//
//  HCSuperCRMModel.h
//  HelloCall
//
//  Created by WangYongpeng on 13-9-21.
//  Copyright (c) 2013年 HC. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "HCCallListModel.h"

typedef enum
{
    ECustomAttribute_1,
    ECustomAttribute_2,
}ECustomAttribute;

typedef enum
{
    ECustomType_Transaction,        //成交用户
    ECustomType_Potential,          //潜在用户
    ECustomType_Follow,             //继续跟进用户
    ECustomType_GiveUp,             //放弃沟通用户
}ECustomType;

@interface HCCRMCustomInfo : NSObject

@property (nonatomic, retain)NSString*  userID;                    //ID
//@property (nonatomic, assign)int     ID;                    //ID            
@property (nonatomic, copy)NSString* customPhoneNumber;     //用户号码
@property (nonatomic, copy)NSString* mobilePhoneNumber;     //联系手机
@property (nonatomic, copy)NSString* phoneNumber;           //座机号码
@property (nonatomic, copy)NSString* contact;               //联系人
@property (nonatomic, copy)NSString* company;               //公司单位
@property (nonatomic, copy)NSString* qqNumber;              //QQ号
@property (nonatomic, copy)NSString* email;                 //邮件地址
@property (nonatomic, copy)NSString* web;                   //网站
@property (nonatomic, assign)ECustomAttribute attribute;    //客户属性
@property (nonatomic, assign)int    nextVisitTime;          //下次沟通时间（单位:天）
@property (nonatomic, retain)NSString*  Memo;               //备忘录
@property (nonatomic, retain)NSDate*    initTime;           //初识沟通时间
@property (nonatomic, assign)CallSourceType sourceType;     //来源
@property (nonatomic, assign)int    potentialCustomersTime; //转为潜在客户周期（单位：天）
@property (nonatomic, assign)int    transactionTime;        //成交周期（单位:天）
@property (nonatomic, assign)int    visitCount;             //沟通次数
@property (nonatomic, assign)int    sumCallTime;            //通过总时长(单位:分钟)
@property (nonatomic, assign)int    reVisitTime;            //回访周期（单位:天）
//@property (nonatomic, retain)NSMutableArray* remarkInfoList;//备注列表

@end

//@protocol HCSuperCRMModelDelegate <NSObject>
//
//- (void)queryCustListDataUpdate;
//- (void)
//
//@end

@interface HCSuperCRMModel : HCComModel

@property (nonatomic, retain)NSString* staffID;                 //员工Id
@property (nonatomic, retain)NSString* workPhoneNumber;         //工作手机

//@property (nonatomic, assign)id<HCSuperCRMModelDelegate> delegate;

+ (HCSuperCRMModel*)defaultModel;

- (int)allCRMCustomCount;
- (NSArray*)getCustomArrayByType:(ECustomType)type;
- (int)sumCallCount;
- (int)sumCallTime;
- (void)addCustonInfoByCallInfo:(HCCallInfo*)callInfo;
- (void)removeCustomInfoByUserId:(NSString*)userId;

- (void)addCustomInfo:(HCCRMCustomInfo *)customInfo customType:(ECustomType)customType;
- (BOOL)modifyCustomInfo:(HCCRMCustomInfo*)customInfo customID:(NSString*)customID;
- (HCCRMCustomInfo*)getCustomInfoByID:(NSString*)customID customType:(ECustomType)customType;
@end
